<!--
 * @Author: LiMG
 * @Date: 2024-01-26 23:22:08
 * @Description: 系统登录页面
-->
<script setup lang="ts" name="SystemLogin">
import { ref } from "vue";

let username = ref("");
let password = ref("");
const login = () => {
    // 处理登录逻辑
    window.location.href = "/";
};
// 重置
const reset = () => {
    // 处理重置逻辑
    username.value = "";
    password.value = "";
};
</script>

<template>
    <div class="login-container">
        <div class="background-image"></div>
        <div class="login-card">
            <div class="login-item">
                <div class="label">用户名</div>
                <div class="field">
                    <input v-model="username" type="text" />
                </div>
            </div>
            <div class="login-item">
                <div class="label">密码</div>
                <div class="field">
                    <input v-model="password" type="password" />
                </div>
            </div>
            <div class="login-item">
                <div class="btn">
                    <el-button type="primary" @click="login">登录</el-button>
                    <el-button @click="reset">重置</el-button>
                </div>
            </div>
        </div>
    </div>
</template>

<style scoped lang="scss">
.login-container {
    height: 100vh;
    width: 100vw;

    .background-image {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        background: url('/images/login/login-background.jpg');
        background-size: 100% 100%;
        animation: bg-animation 10s ease-in-out infinite;
    }

    .login-card {
        width: 300px;
        height: 300px;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
        padding: 20px;
        box-sizing: border-box;
        position: relative;
        z-index: 1;
        top: 200px;
        left: calc(100% - 500px);

        .login-item {
            margin-bottom: 20px;

            .label {
                font-size: 14px;
                color: #333;
                margin-bottom: 5px;
            }

            .field {
                input {
                    width: 100%;
                    height: 40px;
                    border: 1px solid #ccc;
                    border-radius: 5px;
                    padding: 0 10px;
                    box-sizing: border-box;
                }
            }

            .btn {
                width: 100%;
                height: 30px;
                cursor: pointer;
                display: flex;
                justify-content: center;
                align-items: center;
            }
        }

        .login-btn {
            width: 100%;
            height: 40px;
            background: #409eff;
            color: #fff;
            border-radius: 5px;
            border: none;
            cursor: pointer;
        }
    }
}

@keyframes bg-animation {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}
</style>
